home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_jade.idb / usr / freeware / include / sp / lib / Id.h.z / Id.h
Encoding:
C/C++ Source or Header  |  1999-07-21  |  983 b   |  61 lines

  1. // Copyright (c) 1994 James Clark
  2. // See the file COPYING for copying permission.
  3.  
  4. #ifndef Id_INCLUDED
  5. #define Id_INCLUDED 1
  6.  
  7. #ifdef __GNUG__
  8. #pragma interface
  9. #endif
  10.  
  11. #include "Named.h"
  12. #include "Location.h"
  13. #include "Vector.h"
  14.  
  15. #ifdef SP_NAMESPACE
  16. namespace SP_NAMESPACE {
  17. #endif
  18.  
  19. class Id : public Named {
  20. public:
  21.   Id(const StringC &);
  22.   void define(const Location &);
  23.   void addPendingRef(const Location &);
  24.   Boolean defined() const;
  25.   const Location &defLocation() const;
  26.   const Vector<Location> &pendingRefs() const;
  27. private:
  28.   Location defLocation_;
  29.   Vector<Location> pendingRefs_;
  30. };
  31.  
  32. inline
  33. Boolean Id::defined() const
  34. {
  35.   return !defLocation_.origin().isNull();
  36. }
  37.  
  38. inline
  39. const Location &Id::defLocation() const
  40. {
  41.   return defLocation_;
  42. }
  43.  
  44. inline
  45. const Vector<Location> &Id::pendingRefs() const
  46. {
  47.   return pendingRefs_;
  48. }
  49.  
  50. inline
  51. void Id::addPendingRef(const Location &loc)
  52. {
  53.   pendingRefs_.push_back(loc);
  54. }
  55.  
  56. #ifdef SP_NAMESPACE
  57. }
  58. #endif
  59.  
  60. #endif /* not Id_INCLUDED */
  61.